<?php


namespace api\modules\openapi\controllers;


use api\modules\app\services\UnitService;

class IotController extends BaseController
{
    public function actionDelIot(){
        try {
            $iotCode = $this->getParams('iot_code');
            if(empty($iotCode)){
                throw new \Exception('iot_code不能为空。');
            }
            $result = UnitService::delIotLinks($iotCode);
            return $this->makeApiData(['data' => $result],[]);
        }catch (\Exception $e){
            return $this->makeApiData([],['msg' => $e->getMessage()]);
        }
    }
}